@extends('layouts.template')

@section('title', '管理后台')

@section('content')

    <script>
        var selectedMenu = 'order/all';
        var selectedTitle = '订单详情';

        $(function(){

            var form = new Vue({
                el:'#contentpanel',
                data:{
                },
                computed:{
                },
                mounted:function(){
                },
                watch: {
                },
                methods:{
                },
                components:{
                }
            });

            window.showImage = function(source)
            {
                $("#image").find(".modal-content").html("<image src='"+source+"' width='100%' />");
                $("#image").modal('show');
            }

            $("#image").on("hidden.bs.modal", function() {
                $(this).removeData("bs.modal");
                $(this).find('.modal-content').empty();
            });

        });

    </script>

    <div class="contentpanel" id="contentpanel">

        <div class="row">
            <div class="col-md-12">

                <!-- Tab panes -->
                <div class="tab-content mb30">
                    <div class="tab-pane active" id="detail">

                        <div class="table-responsive">
                            <table class="table mb30">
                                <tbody>
                                <?php foreach ($order->offers as $row):?>
                                <tr data-id="{{$row->master_id}}">
                                    <td>
                                        <img style="float:left;margin-right:10px;" width="75" height="75" src="{{$row->master->head_img_url}}">
                                        {{$row->master->real_name}}&nbsp;&nbsp;&nbsp;&nbsp;{{$row->master->phone}}<br>
                                        保证金{{$row->master->wallet->assure_fund}}元<br>
                                        信誉{{$row->master->stars}}星<br>
                                        承诺{{count($row->master->service_type)}}项服务<br>
                                    </td>
                                    <td>
                                        总接单：{{$row->master->order_count}}单<br>
                                        总评分：{{$row->master->score}}分<br>
                                        好评率：{{$row->master->praise_rate}}%<br>
                                        投诉记录：0次<br>
                                    </td>
                                    <td>
                                        报价：{{$row->price}}元<br>
                                        留言：{{$row->message}}<br>
                                        @if ($row->employed)
                                            <a class="btn btn-danger" onclick="return confirm('确定雇佣')" href="{{url("mock/employ/{$row->order_id}/{$row->master_id}")}}">已雇佣(点击模拟雇佣)</a>
                                        @else
                                            <a class="btn btn-info" onclick="return confirm('确定雇佣')" href="{{url("mock/employ/{$row->order_id}/{$row->master_id}")}}">雇佣他(点击模拟雇佣)</a>
                                        @endif
                                    </td>
                                </tr>
                                <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>

                    </div><!-- tab-pane -->
                </div><!-- tab-content -->

            </div><!-- col-md-6 -->
        </div>
    </div><!-- contentpanel -->

    <div class="modal fade" id="image" tabindex="-1" role="dialog" data-keyboard="false">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
            </div>
        </div>
    </div>

@endsection

